{extend name="base" /}
{block name="body"}
<style type="text/css">
.mleft {
    margin-right: 10px;
}
</style>
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui"><a href="{:url('/admin/player')}">账号管理</a></li>
            <li class="layui"><a href="{:url('/admin/jinling')}">旧平台SDK账号</a></li>
            <li class="layui-this">实名信息查询</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
            <div class="layui-form-item">
                <form class="layui-form layui-form-pane" action="{:url('/admin/player/auth')}" method="get">
                    <div class="layui-inline mleft">
                        <label class="layui-form-label">玩家账号</label>
                        <div class="layui-input-inline" style="width: 120px;">
                            <input type="text" name="account" value="{:input('account')}" placeholder="请输入账号" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn">搜索</button>
                    </div>
                </form>
                </div>
                <hr>

                {if condition="!empty($data)"}
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 30px;">ID</th>
                            <th style="width: 60px;">玩家账号</th>
                            <th style="width: 60px;">姓名</th>
                            <th style="width: 60px;">身份证号</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name="data" item="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.account}</td>
                                <td>{$vo.real_name}</td>
                                <td>{$vo.id_card}</td>
                            </tr>
                        {/foreach}
                        </tbody>
                    </table>
                    <!--分页-->
                {:$reg_list->render()}
                {/if}
            </div>
        </div>
    </div>
</div>
{/block}

{block name="script"}
<script>
layui.use(['jquery','laydate'],function () {
    var laydate = layui.laydate;
    var $ = layui.$;

    $('#exportBtn').on('click', function() {
        // var formDataArray = $('form').serializeArray();
        $('form').attr('action', '{:url("/admin/export")}').submit();
    });
var startDate = layui.laydate.render({
  elem: '#LAY_range_s',
  min: '2017-12-28',
    type: 'datetime',
    //btns: ['confirm'],
  done:function(value,date){
    if( value !== '' ){
      endDate.config.min.year = date.year;
      endDate.config.min.month = date.month - 1;
      var day = date.date;
      if(date.hours == 23 && date.minutes == 59 && date.seconds == 59){
        day = day + 1;
      }else{
        endDate.config.min.hours = date.hours;
        endDate.config.min.minutes = date.minutes;
        endDate.config.min.seconds = date.seconds;
      }
      endDate.config.min.date = day;
      endDate.config.btns = ['clear','confirm'];
    }else{
      endDate.config.min.year = '';
      endDate.config.min.month = '';
      endDate.config.min.date = '';
      endDate.config.min.hours = '';
      endDate.config.min.minutes = '';
      endDate.config.min.seconds = '';
      endDate.config.btns = ['clear','now','confirm'];
    }
  }
});


var endDate = layui.laydate.render({
  elem: '#LAY_range_e',
  min: '2017-12-28',
    type: 'datetime',
    //btns: ['confirm'],
  done:function(value,date){
    if( value !== '' ){
      startDate.config.max.year = date.year;
      startDate.config.max.month = date.month - 1;
      var day = date.date;
      if(date.hours == 0 && date.minutes == 0 && date.seconds == 0){
        day = day - 1;
      }else{
        startDate.config.max.hours = date.hours;
        startDate.config.max.minutes = date.minutes;
        startDate.config.max.seconds = date.seconds;
      }
      startDate.config.max.date = day;          
      startDate.config.btns = ['clear','confirm'];
    }else{
      startDate.config.max.year = '';
      startDate.config.max.month = '';
      startDate.config.max.date = '';

      startDate.config.max.hours = '';
      startDate.config.max.minutes = '';
      startDate.config.max.seconds = '';
      startDate.config.btns = ['clear','now','confirm'];
    }
  }
});
});
	
layui.use(['form', 'laydate'], function(){
    var form = layui.form;
     var laydate = layui.laydate;
     
	//监听开启开关
      form.on('switch(checkbtn)', function(data){
        var url  = $(this).attr('data-url');
    	var date = $(this).attr('data');
    	var type = this.checked ? 1:0;
    	$.post(url,{id:date,type:type},function(info){
    	    layer.msg(info.msg);	
    		})
    });
});

</script>
{/block}